package data;
/**
 * @author Administrator
 *
 */
public class ItemRecord extends Record {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;
	
	private double price;
	
	private double special_price;
	
	private int number;

	private double total_price;
	
	
	/**
	 * 
	 */
	public ItemRecord(){
		
	}
	
	
	/**
	 * @param ID
	 * @param name
	 * @param price
	 * @param number
	 * @param special_price
	 * @param total_price
	 * @param special_start_time
	 * @param special_end_time
	 */
	public ItemRecord(String ID,String name,double price,int number,double special_price,double total_price){
		this.set(ID, name, price, number, special_price, total_price);
	}
	
	
	/**
	 * @param ID
	 * @param name
	 * @param price
	 * @param number
	 * @param special_price
	 * @param total_price
	 * @param special_start_time
	 * @param special_end_time
	 */
	public void set(String ID,String name,double price,int number,double special_price,double total_price){
		this.ID=ID;
		this.name=name;
		this.price=price;
		this.number=number;
		this.special_price=special_price;
		this.total_price=total_price;
	}
	

	/**
	 * @return String 
	 */
	public String getName(){
		return name;
	}
	
	
	/**
	 * @param name
	 */
	public void setName(String name){
		this.name=name;
	}
	
	
	/**
	 * @return double
	 */
	public double getPrice(){
		return price;
	}
	
	
	/**
	 * @param price
	 */
	public void setPrice(int price){
		this.price=price;
	}
	
	
	/** 
	 * @return double
	 */
	public double getSpecialPrice(){
		return special_price;
	}
	
	
	/**
	 * @param special_price
	 */
	public void setSpecialPrice(double special_price){
		this.special_price=special_price;
	}
	
	
	/**
	 * @return int
	 */
	public int getNum(){
		return number;
	}
	
	
	/**
	 * @param number
	 */
	public void setNum(int number){
		this.number=number;
	}
	
	
	/**
	 * @return double
	 */
	public double getTotalPrice(){
		return total_price;
	}
	
	
	/**
	 * @param total_price
	 */
	public void setTotalPrice(int total_price){
		this.total_price=total_price;
	}
		
	
	/**
	 * @return double
	 */
	public void calculateTotalPrice(){
		total_price=number*special_price;
	}
	
	
	
	/**
	 * @return String
	 */
	public String getItemInfo(){
		String info=ID+","+name+","+price;
		return info;
	}
	
	
	/**
	 * @return String
	 */
	public String getStoreInfo(){
		String info=ID+","+name+","+price+","+number;
		return info;
	}
	
	
	/**
	 * @return String
	 */
	public String getSaleInfo(){
		String info=ID+","+name+","+price+","+special_price+","+number+","+total_price;
		return info;
	}
	
	
	/**
	 * @return String
	 */
	public String getGiftInfo(){
		String info=ID+","+name+","+number;
		return info;
	}
	
}
